const path = require("path");
const webpack = require("webpack");

module.exports = {
  entry: {
    main: "./src/main",
  },
  output: {
    path: path.join(__dirname, "./dist"),
    filename: "[name].[hash:8].js",
  },
  module: {
    rules: [
      // {
      //   test: /\.js$/,
      //   use: {
      //     loader: "babel-loader",
      //     options: {
      //       presets: ["@babel/preset-env"]
      //     },
      //   },
      // },
      {
        test: /\.js$/,
        exclude: /(node_modules)/, // 排除文件
        loader: 'babel-loader'
      }, {
        test: /\.vue$/,
        use: [{
            loader: "vue-loader",
          },
          {
            loader: "iview-loader",
            options: {
              prefix: false,
            },
          },
        ],
      },
      {
        test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
        loader: "url-loader?limit=1024",
      },
    ],
  },
  resolve: {
    extensions: [".js", ".vue"],
    alias: {
      vue: "vue/dist/vue.esm.js",
    },
  },
};